home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Univers Interactif 3
/
INTERACTIF.BIN
/
pc
/
planeten
/
internet
/
intersl1.sit
/
InterSLIP Scripts 1.0
/
Generic Modem Driver
next >
Wrap
Text File
|
1994-06-16
|
4KB
|
200 lines
!Generic Modem Driver CCL Script for InterSLIP.
! Copyright 1994 Dan Cottler, et al. All rights reserved.
!
! Drive just about any modem from InterSLIP.
!
! In case of difficulty, send email to <dcottler@halcyon.com>.
!
! Revision History:
! 06/02/94 V1.0-006 First public release.
!
! The init string supplied from the InterSLIP set-up dialog should set
! the modem to its Factory defaults then -
! enable Reliable or Auto-Reliable Mode with fallbacks as desired,
! enable V.42bis compression (if desired),
! enable independently buffered DTE and DCE speeds,
! disable DTR (it's incompatible with h/w flow control on a Mac),
! enable bidirectional _serial_port_ hardware (CTS/RTS) flow control.
!
! A typical (generic) init string looks like:
! "AT&F&D0&K3" to accept any speed connection.
! "AT&F&D0&K3NS37=9" to force a 9600bps connection.
! "AT&F&D0&K3NS37=11" to force a 14.4Kbps connection.
!
! "E0Q0V1" is automatically appended to the init string. And "M0" is used
! to turn off the speaker, if required. Hang-up is done by getting the modem's
! attention then issuing the standard reset command, "ATZ". This should do
! the hang-up and reset the modem to the defaults the user has pre-saved. DTR
! is then dropped to close the port.
!------
!+
!INITIALIZATION!!!!
!-
@ANSWER
@ORIGINATE
!
! Set up the serial port and clear the retry counter.
! Set up the modem --
! send an empty <cr> to clear the input buffer.
! pause for 1/2 second to let internal modems wake-up.
! send the user-supplied string, plus misc stuff.
! if the speaker-on flag is false, turn off speaker.
!
!SerReset 57600, 0, 8, 1
HSReset 0 0 0 0 0 0
SetTries 0
!
note "Initializing modem..."
write "\13"
pause 10
write "^4E0Q0V1S0=0\13"
matchclr
matchstr 1 10 "OK"
matchstr 2 90 "ERROR"
matchread 150
note "Init failure. Check init string!"
pause 30
exit -6019
!
@LABEL 10
ifstr 2 20 "1"
write "ATM0\13"
matchclr
matchstr 1 20 "OK"
matchstr 2 90 "ERROR"
matchread 100
exit -6019
!
@LABEL 20
ifANSWER 60
!+
!ORIGINATE MODE!!!!
!-
!
! The modem is ready for use, so --
! dial the host then wait for it to answer.
! if the lines are busy or the carrier drops, retry 2x.
!
note "Dialing ^3^1..."
write "ATDT^3^1\13"
pause 30
note "Waiting to establish comm link..."
matchclr
matchstr 1 30 "BUSY"
matchstr 2 40 "NO CARRIER"
matchstr 3 50 "CONNECT"
matchstr 4 90 "ERROR"
matchstr 5 91 "NO ANSWER"
matchstr 6 92 "NO DIALTONE"
matchread 600
note "Timed-out waiting for carrier!"
write "\13"
pause 15
exit -6019
!
@LABEL 30
inctries
iftries 3 45
note "The line is BUSY! Retrying..."
pause 15
jump 20
!
@LABEL 40
inctries
iftries 3 45
note "Got NO CARRIER! Retrying..."
pause 15
jump 20
!
@LABEL 45
note "Three connect attempts failed!"
pause 15
note "<Idle>"
exit -6019
!
@LABEL 50
! A comm link has been established --
! turn on h/w handshaking in InterSLIP (just gets ignored if no hwhsk cable).
! tell the s/w we're talking with a DCE speed of 14400bps. This may not
! be true, but it seems to perform better than telling it the actual speed.
! pause a second to let the initial i/o burst pass.
!
note "Communications link established!"
HSReset 0 1 0 0 0 0
CommunicatingAt 14400
pause 10
exit 0
!+
!ANSWER MODE!!!!
!-
@LABEL 60
!
! The modem is ready for use --
! wait for the modem to say "RING", then answer the call.
! or enable AA then wait for the call.
!
note "Answer mode is not implemented!"
pause 20
exit -1
!+
!HANG UP THE MODEM!!!!
!-
@HANGUP
!
! The modem needs to be shutdown, so --
! turn off handshaking in InterSLIP (clear any possible lock-up).
! get the modem's attention.
! tell the modem to reset.
! drop the DTR line.
!
HSReset 0 0 0 0 0 0
pause 10
note "Hanging up & resetting the modem..."
write "\13"
pause 30
write "+++"
matchclr
matchstr 1 81 "OK"
matchstr 2 81 "NO CARRIER"
matchread 60
@LABEL 81
write "ATZ\13"
matchclr
matchstr 1 82 "OK"
matchstr 2 82 "NO CARRIER"
matchread 200
@LABEL 82
DTRClear
note "The modem is on-hook and reset (I hope)!"
pause 15
note "<Idle>"
exit 0
!+
!Error messages - Just issue msg(s) then exit.
!-
!
@LABEL 90
note "Help!!!! Got ERROR from modem!!!!"
pause 15
note "Check the init string & phone number!"
pause 20
exit -6019
!
@LABEL 91
note "Got NO ANSWER!"
pause 20
exit -6019
!
@LABEL 92
note "Got NO DIALTONE!"
pause 15
note "Check the telephone cables!"
pause 20
exit -6019
!End of Generic Modem Driver CCL Script.